package com.heh.mybatisplus.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.heh.mybatisplus.entity.RoleMenuEntity;
import com.heh.mybatisplus.mapper.RoleMenuMapper;
import com.heh.mybatisplus.service.RoleMenuService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @项目名： spring-emq
 * @包名： com.heh.mybatisplus.service.impl
 * @文件名: RoleMenuServiceImpl
 * @创建者: liufudong@szyh-smart.com
 * @创建时间: 2024/10/23 22:38
 * @描述：
 */
@Service
public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenuEntity> implements RoleMenuService {
    @Override
    public Page<RoleMenuEntity> pageQuery(RoleMenuEntity role_menu) {
        Long l = baseMapper.selectCountDynamic();
        List<RoleMenuEntity> roleMenuEntities = baseMapper.selectDynamicPageQuery(role_menu);
//        return new Page<>().set;
        return new Page<RoleMenuEntity>()
                .setCurrent(role_menu.getPageNo())
                .setSize(role_menu.getPageSize())
                .setTotal(l)
                .setRecords(roleMenuEntities);
    }
//    @Override
//    public Long selectCountDynamic() {
//        return baseMapper.selectCountDynamic();
//    }
//
//    @Override
//    public List<RoleMenuEntity> selectDynamicPageQuery(RoleMenuEntity roleMenuEntity) {
//        return baseMapper.selectDynamicPageQuery(roleMenuEntity);
//    }
}
